package com.zzl.ov_library.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzl.ov_library.entity.Recommendation;
import com.zzl.ov_library.entity.RecommendationVO;
import com.zzl.ov_library.service.RecommendationService;
import com.zzl.ov_library.mapper.RecommendationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 周
 * @description 针对表【recommendation】的数据库操作Service实现
 * @createDate 2025-04-17 22:10:33
 */
@Service
public class RecommendationServiceImpl extends ServiceImpl<RecommendationMapper, Recommendation>
        implements RecommendationService {

    @Autowired(required = false)
    private RecommendationMapper recommendationMapper;
    @Override
    public Page<RecommendationVO> listRecommendation(Integer page, Integer limit) {
        Page<RecommendationVO> pageRequest = new Page<>(page, limit);
        // 调用Mapper分页查询
        return recommendationMapper.selectFirstByIsbnGroupOrderByIsbnCountDesc(pageRequest);
    }
}




